
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class ButtonBasic extends StatelessWidget{
  const ButtonBasic({super.key});


  @override
  Widget build(BuildContext context) {
    return Center(
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          ElevatedButton(onPressed: (){}, child: const Text("ElevatedButton"),),
          const SizedBox(height: 12,),
          TextButton(onPressed: (){}, child: const Text("TextButton")),
          const SizedBox(height: 12,),
          OutlinedButton(onPressed: (){}, child: const Text("OutlinedBtn")),
          const SizedBox(height: 12,),
          IconButton(onPressed: (){}, icon: const Icon(Icons.star,color: Colors.white,),style: const ButtonStyle(backgroundColor: WidgetStatePropertyAll(Colors.lightBlue)),),
          const SizedBox(height: 12,),
          FilledButton(onPressed: (){}, child: const Text("FilledButton")),
          const SizedBox(height: 12,),
          //ElevatedButton、TextButton、OutlinedButton都有一个icon 构造函数，通过它可以轻松创建带图标的按钮
          ElevatedButton.icon(onPressed: (){}, label: const Text("icon"),icon: const Icon(Icons.add),),
          const SizedBox(height: 12,),
          OutlinedButton.icon(onPressed: (){}, label: const Text("outLine"),icon: const Icon(Icons.subject),),
          const SizedBox(height: 12,),
          TextButton.icon(onPressed: (){}, label: const Text("outLine"),icon: const Icon(Icons.face),)
        ],
      ),
    );
  }
}